package yzserver.sx4a.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import yzserver.sx4a.dao.IDepartmentDao;
import yzserver.sx4a.domain.DepartmentDomain;

import java.util.HashMap;
import java.util.List;

public class DepartmentDaoImpl extends BaseIbnmsDao implements IDepartmentDao {


    @Override
    public DepartmentDomain selDepartment(String departmentid) {
        HashMap map = new HashMap();
        map.put("departmentid",departmentid);
        return (DepartmentDomain)querySingle("shanxi_selDepartment",map);
    }

    @Override
    public void addDepartment(DepartmentDomain department) throws Exception {
        insert("shanxi_addDepartment",department);
    }

    @Override
    public void updDepartment(DepartmentDomain department) throws Exception {
        update("shanxi_updDepartment",department);
    }

    @Override
    public void delDepartment(String departmentid) throws Exception {
        HashMap map = new HashMap();
        map.put("departmentid",departmentid);
        delete("shanxi_delDepartment",map);
    }

    @Override
    public List<DepartmentDomain> selAllDepartment(String departmentid) {
        HashMap map = new HashMap();
        map.put("departmentid",departmentid);
        return (List<DepartmentDomain>)query("shanxi_selAllDepartment", map);
    }
}
